package org.medicalinstrument.dao;

import org.medicalinstrument.bean.PageBean;
import org.medicalinstrument.bean.Product;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public interface ProductDao {
    //商品总数量
    int totalCount(String conType, String conName) throws SQLException;

    //报废商品总数量
    int brokenCount() throws SQLException;

    //根据二维码删除商品
    boolean deleteByProductQR(String ProductQR) throws SQLException;

    //根据二维码修改商品
    boolean updateByProductQR(Product product) throws SQLException;

    //根据二维码查询商品
    Product getByProductQR(String ProductQR) throws SQLException;

    //添加商品
    boolean addProduct(Product product) throws SQLException;

    //分页显示
    List<Product> showByPage(PageBean page, String conType, String conName) throws SQLException;

    List<Product> showByPage1(PageBean page, String conType, String conName) throws SQLException;

    //取出所有（未报废并且商品状态为0）商品信息
    List<Product> getAllProduct() throws SQLException;

    //根据二维码修改商品
    boolean updateState(Connection conn, int state, String ProductQR) throws SQLException;

    boolean updateState(int state, String productQR , int buyCount) throws SQLException;
}
